package com.zhike.controller;

import com.zhike.service.DwsTempWindowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhike
 * @CreateTime: 2024/5/2
 * @Description:
 */
@RestController
@RequestMapping("temp")
public class TempWeekController {
    @Autowired
    private DwsTempWindowService dwsTempWindowService;

    /**
     * 获取最近7日每辆车的电机最高温度和平均温度
     */
    @PostMapping("getTempWeek")
    public String getTempWeek(@RequestBody String filter){
        return dwsTempWindowService.getTempWeek(filter);
    }

    /**
     * 获取最近7日每辆车的电机控制器最高温度和平均温度
     */
    @PostMapping("getTempConWeek")
    public String getTempConWeek(@RequestBody String filter){
        return dwsTempWindowService.getTempConWeek(filter);
    }

    /**
     * 获取最近7日每辆车的电池最高温度和温度异常次数
     */
    @PostMapping("getTempCountWeek")
    public String getTempCountWeek(@RequestBody String filter){
        return dwsTempWindowService.getTempCountWeek(filter);
    }
}
